home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / RenderLib.lha / RenderLib / include / render / render.h next >
Encoding:
C/C++ Source or Header  |  1997-06-26  |  9.6 KB  |  305 lines

  1. #ifndef RENDER_H
  2. #define RENDER_H
  3. /*
  4. **    $VER: render.h 22.0 (26.6.97)
  5. **
  6. **    render.library definitions
  7. **
  8. **    © 1996 TEK neoscientists
  9. */
  10.  
  11.  
  12.  
  13. #ifndef UTILITY_TAGITEM_H
  14. #include <utility/tagitem.h>
  15. #endif
  16.  
  17.  
  18.  
  19. #define    RND_TAGBASE    (TAG_USER+0x1000)
  20.  
  21.  
  22. /************************************************************************
  23.  
  24.     memhandler
  25.  
  26. ************************************************************************/
  27.  
  28. #define    RND_MemType        (RND_TAGBASE+1)        /* type of memhandler, see below */
  29. #define    RND_MemBlock    (RND_TAGBASE+2)        /* ptr to block of memory */
  30. #define    RND_MemSize        (RND_TAGBASE+3)        /* size of memblock [bytes] */
  31. #define    RND_MemFlags    (RND_TAGBASE+18)    /* memflags (exec/memory.h) */
  32. #define    RND_RMHandler    (RND_TAGBASE+12)    /* to pass a memhandler as an argument */
  33.  
  34. /*
  35.  *    memhandler types
  36.  */
  37.  
  38. #define    RMHTYPE_POOL        1                /* v39 exec dynamic pool */
  39. #define    RMHTYPE_PRIVATE        2                /* private memory pool */
  40. #define    RMHTYPE_PUBLIC        3                /* common public memory */
  41.  
  42.  
  43. /************************************************************************
  44.  
  45.     palette
  46.  
  47. ************************************************************************/
  48.  
  49. #define    RND_PaletteFormat    (RND_TAGBASE+19)    /* palette import/export format */
  50. #define    RND_EHBPalette        (RND_TAGBASE+22)    /* tag to indicate a palette is EHB */
  51. #define    RND_FirstColor        (RND_TAGBASE+23)    /* first palette entry */
  52. #define RND_NewPalette        (RND_TAGBASE+24)    /* dispose the old palette and load a new one */
  53. #define    RND_RGBWeight        (RND_TAGBASE+11)    /* quantization factors */
  54.  
  55. /*
  56.  *    palette format types
  57.  */
  58.  
  59. #define    PALFMT_RGB32        1                    /* ULONG red,green,blue */
  60. #define PALFMT_RGB8            2                    /* ULONG 0x00rrggbb */
  61. #define    PALFMT_RGB4            3                    /* UWORD 0xrgb */
  62. #define    PALFMT_PALETTE        4                    /* render.library palette */
  63.  
  64. /*
  65.  *    palette sort mode types
  66.  *    for the use with SortPalette()
  67.  */
  68.  
  69.     /* no particular order */
  70. #define    PALMODE_NONE            0x0000
  71.  
  72.     /* sort palette entries by brightness */
  73. #define    PALMODE_BRIGHTNESS        0x0001
  74.  
  75.     /* sort palette entries by the number of pixels that they represent.
  76.        You must supply the RND_Histogram taglist argument. */
  77. #define    PALMODE_POPULARITY        0x0002
  78.  
  79.     /* sort palette entries by the number of histogram entries that they
  80.        represent. You must supply the RND_Histogram taglist argument. */
  81. #define    PALMODE_REPRESENTATION    0x0003
  82.  
  83.     /* sort palette entries by their optical significance for the human
  84.        eye. Implementation is unknown to you and may change.
  85.        You must supply the RND_Histogram taglist argument. */
  86. #define PALMODE_SIGNIFICANCE    0x0004
  87.  
  88.     /* sort palette entries by color intensity */
  89. #define    PALMODE_SATURATION        0x0005
  90.  
  91.     /* By default, sort direction is descending, i.e. the precedence is
  92.        more-to-less. Combine with this flag to invert the sort direction. */
  93. #define    PALMODE_ASCENDING        0x0008
  94.  
  95.  
  96. /************************************************************************
  97.  
  98.     histogram related
  99.  
  100. ************************************************************************/
  101.  
  102. #define    RND_HSType            (RND_TAGBASE+4)        /* histogram type, see below */
  103. #define    RND_Histogram        (RND_TAGBASE+9)        /* a histogram as an argument */
  104.  
  105. /*
  106.  *    Histogram / Palette types
  107.  *    to be specified with RND_HSType
  108.  */
  109.  
  110. #define    HSTYPE_12BIT        4                    /* 12bit dynamic histogram */
  111. #define    HSTYPE_15BIT        5                    /* 15bit dynamic histogram */
  112. #define    HSTYPE_18BIT        6                    /* 18bit dynamic histogram */
  113. #define    HSTYPE_21BIT        7                    /* 21bit dynamic histogram */
  114. #define    HSTYPE_24BIT        8                    /* 24bit dynamic histogram */
  115. #define    HSTYPE_12BIT_TURBO    20                    /* 12bit tabular histogram */
  116. #define    HSTYPE_15BIT_TURBO    21                    /* 15bit tabular histogram */
  117. #define    HSTYPE_18BIT_TURBO    22                    /* 18bit tabular histogram */
  118.  
  119. /*
  120.  *    tags that can be queried via QueryHistogram()
  121.  */
  122.  
  123. #define    RND_NumPixels        (RND_TAGBASE+5)        /* # pixels in a histogram */
  124. #define    RND_NumColors        (RND_TAGBASE+6)        /* # colors in a histogram */
  125.  
  126.  
  127. /************************************************************************
  128.  
  129.     rendering and conversions
  130.  
  131. ************************************************************************/
  132.  
  133. #define    RND_ColorMode        (RND_TAGBASE+7)        /* color mode, see below */
  134. #define    RND_DitherMode        (RND_TAGBASE+8)        /* dither mode, see below */
  135. #define    RND_DitherAmount    (RND_TAGBASE+26)    /* dither amount */
  136. #define    RND_OffsetColorZero    (RND_TAGBASE+10)    /* first color index to be output */
  137.  
  138. /*
  139.  *    color mode types
  140.  *    to be specified with RND_ColorMode
  141.  */
  142.  
  143. #define    COLORMODE_CLUT        0x0000                /* normal palette lookup */
  144. #define    COLORMODE_HAM8        0x0001                /* HAM8 mode */
  145. #define    COLORMODE_HAM6        0x0002                /* HAM6 mode */
  146. #define    COLORMODE_MASK        0x0003                /* mask to determine COLORMODE */
  147.  
  148. /*
  149.  *    dither mode types
  150.  *    to be specified with RND_DitherMode
  151.  */
  152.  
  153. #define    DITHERMODE_NONE        0x0000                /* no dither */
  154. #define    DITHERMODE_FS        0x0001                /* Floyd-Steinberg dither */
  155. #define    DITHERMODE_RANDOM    0x0002                /* random dither. amount required. */
  156.  
  157.  
  158. /************************************************************************
  159.  
  160.     miscellaneous
  161.  
  162. ************************************************************************/
  163.  
  164. #define    RND_ProgressHook    (RND_TAGBASE+13)    /* progress callback hook */
  165. #define    RND_SourceWidth        (RND_TAGBASE+14)    /* total input width [pixels] */
  166. #define    RND_DestWidth        (RND_TAGBASE+15)    /* total output width [pixels] */
  167. #define    RND_PenTable        (RND_TAGBASE+16)    /* ptr to a chunky conversion table */
  168. #define    RND_LeftEdge        (RND_TAGBASE+17)    /* chunky data left edge [pixels] */
  169. #define    RND_LineHook         (RND_TAGBASE+20)    /* line callback hook */
  170. #define    RND_MapEngine        (RND_TAGBASE+27)    /* Mapping-Engine */
  171. #define    RND_Interleave        (RND_TAGBASE+28)    /* Interleave */
  172. #define    RND_Palette            (RND_TAGBASE+29)    /* Palette */
  173. #define    RND_Weight            (RND_TAGBASE+30)    /* Weight factor */
  174. #define    RND_ScaleEngine        (RND_TAGBASE+31)    /* ScaleEngine */
  175.  
  176.  
  177. /************************************************************************
  178.  
  179.     alpha-channel and masking
  180.  
  181. ************************************************************************/
  182.  
  183. #define    RND_AlphaChannel    (RND_TAGBASE+32)    /* custom alpha-channel */
  184. #define    RND_AlphaModulo        (RND_TAGBASE+33)    /* bytes between alpha-channel pixels */
  185. #define    RND_AlphaWidth        (RND_TAGBASE+34)    /* width of alpha-channel array */
  186. #define    RND_MaskRGB        (RND_TAGBASE+35)    /* masking RGB for CreateAlphaArray */
  187. #define    RND_MaskFalse        (RND_TAGBASE+36)    /* mask value for outside color range */
  188. #define    RND_MaskTrue        (RND_TAGBASE+37)    /* mask value for inside color range */
  189.  
  190. #define    RND_SourceWidth2    (RND_TAGBASE+38)    /* total source width for 3channel operations */
  191. #define    RND_AlphaChannel2    (RND_TAGBASE+39)    /* second custom alpha-channel */
  192. #define    RND_AlphaModulo2    (RND_TAGBASE+40)    /* pixel modulo for a second alpha-channel */
  193. #define    RND_AlphaWidth2        (RND_TAGBASE+41)    /* width of a second alpha-channel array */
  194.  
  195.  
  196. /************************************************************************
  197.  
  198.     PixelFormat
  199.  
  200. ************************************************************************/
  201.  
  202. #define    RND_PixelFormat    (RND_TAGBASE+25)        /* pixel format, see below */
  203.  
  204. #define    PIXFMTB_CHUNKY        3
  205. #define    PIXFMTB_BITMAP        4
  206. #define    PIXFMTB_RGB            5
  207.  
  208. #define    PIXFMT_CHUNKY_CLUT    ((1L << PIXFMTB_CHUNKY) + COLORMODE_CLUT)
  209. #define    PIXFMT_0RGB_32        ((1L << PIXFMTB_RGB) + 0)
  210.  
  211. /*
  212.  *    these types are currently not used by render.library, but
  213.  *    some of them are applicable for guigfx.library functions:
  214.  */
  215.  
  216. #define    PIXFMT_CHUNKY_HAM8    ((1L << PIXFMTB_CHUNKY) + COLORMODE_HAM8)
  217. #define    PIXFMT_CHUNKY_HAM6    ((1L << PIXFMTB_CHUNKY) + COLORMODE_HAM6)
  218. #define    PIXFMT_BITMAP_CLUT    ((1L << PIXFMTB_BITMAP) + COLORMODE_CLUT)
  219. #define    PIXFMT_BITMAP_HAM8    ((1L << PIXFMTB_BITMAP) + COLORMODE_HAM8)
  220. #define    PIXFMT_BITMAP_HAM6    ((1L << PIXFMTB_BITMAP) + COLORMODE_HAM6)
  221.  
  222. #define    PIXFMT_RGB_24        ((1L << PIXFMTB_RGB) + 1)
  223.  
  224.  
  225. /************************************************************************
  226.  
  227.     ExtractPalette return codes
  228.  
  229.     You must at least check for EXTP_SUCCESS.
  230.     EXTP_NO_DATA indicates that there were no colors
  231.     in the histogram.
  232.  
  233. ************************************************************************/
  234.  
  235. #define    EXTP_SUCCESS            0
  236. #define    EXTP_NOT_ENOUGH_MEMORY    1
  237. #define    EXTP_CALLBACK_ABORTED    2
  238. #define    EXTP_NO_DATA            3
  239.  
  240.  
  241. /************************************************************************
  242.  
  243.     AddRGB, AddRGBImage and AddChunkyImage return codes
  244.  
  245.     You must at least check for ADDH_SUCCESS.
  246.     If not delivered, the histogram might be
  247.     inaccurate.
  248.  
  249. ************************************************************************/
  250.  
  251. #define    ADDH_SUCCESS                0
  252. #define    ADDH_NOT_ENOUGH_MEMORY        1
  253. #define    ADDH_CALLBACK_ABORTED        2
  254. #define ADDH_NO_DATA                3
  255.  
  256.  
  257. /************************************************************************
  258.  
  259.     Render return codes
  260.  
  261.     You must at least check for REND_SUCCESS.
  262.     If not delivered, the image has not been
  263.     rendered completely.
  264.  
  265. ************************************************************************/
  266.  
  267. #define    REND_SUCCESS                0
  268. #define    REND_NOT_ENOUGH_MEMORY        1
  269. #define    REND_CALLBACK_ABORTED        2
  270. #define    REND_NO_VALID_PALETTE        3
  271.  
  272.  
  273. /************************************************************************
  274.  
  275.     SortPalette return codes
  276.  
  277.     You must at least check for SORTP_SUCCESS.
  278.     SORTP_NO_DATA indicates that there were data missing,
  279.     e.g. you specified no histogram or the histogram was empty.
  280.  
  281. ************************************************************************/
  282.  
  283. #define    SORTP_SUCCESS                0
  284. #define    SORTP_NO_DATA                1
  285. #define    SORTP_NOT_ENOUGH_MEMORY        2
  286.  
  287.  
  288. /************************************************************************
  289.  
  290.     conversion return codes
  291.  
  292.     These return codes apply to conversion functions
  293.     such as Chunky2RGB and ConvertChunky.
  294.  
  295. ************************************************************************/
  296.  
  297. #define    CONV_SUCCESS                0
  298. #define    CONV_CALLBACK_ABORTED        1
  299. #define CONV_NOT_ENOUGH_MEMORY        2
  300.  
  301.  
  302. /***********************************************************************/
  303.  
  304. #endif
  305.